#coding=utf-8
from rest_framework import serializers
from .models import UserProfile, Region, Company, UserJob, Department, CustomerProfile



class UserProfileSerializer(serializers.ModelSerializer):
    class Meta:
        model = UserProfile
        #fields = '__all__'
        fields = ('id', 'last_login', 'mobile', 'first_name', 'last_name', 'email', 'nick_name', \
                  'gender', 'avator', 'description', 'updated_at', 'created_at', 'job', 'departments')


class RegionSerializer(serializers.ModelSerializer):
    class Meta:
        model = Region
        fields = '__all__'

class CompanySerializer(serializers.ModelSerializer):
    class Meta:
        model = Company
        fields = '__all__'

class UserJobSerializer(serializers.ModelSerializer):
    class Meta:
        model = UserJob
        fields = '__all__'

class DepartmentSerializer(serializers.ModelSerializer):
    class Meta:
        model = Department
        fields = '__all__'

class CustomerProfileSerializer(serializers.ModelSerializer):
    class Meta:
        model = CustomerProfile
        fields = ('id', 'name', 'gender', 'mobile', 'avator', 'address', 'description', 'sale',)
